load mnist_train_all;

tic
X = data(1:1000,:);
%[A,B] = knnsch(X,10);
[dist,nn] = findknn(double(data'),10);
toc